public class 记录创建了多少个类 {
    public static void main(String[] args) {
        User u1 = new User();
        User u2 = new User();
        User u3 = new User();
        User u4 = new User();
        User u5 = new User();
        System.out.println(User.number);
    }
}
class User{
    public static int number;

    public User() {
        number = ++number;
    }
}
